package com.iot.message.controller;

import com.alibaba.fastjson2.JSONObject;
import com.iot.common.entity.MessageRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/message")
@Slf4j
public class MessageController {

    @PostMapping("/getMessage")
    public String getMessage(@RequestBody MessageRequest messageRequest){
        log.info("messageRequest: " + JSONObject.toJSONString(messageRequest));

        return "message !!!!!---->" + messageRequest.getId();
    }

}
